import java.util.Arrays;

import java.util.TreeSet;
import java.util.Iterator;
import java.util.Scanner;
import java.util.Set;

public class Main {
	public static void main(String[] args) {
		
	   int i=0;
		Scanner input=new Scanner(System.in);
		Set<String>strSet=new TreeSet<String>();
		String x;
		while(true){
			x=input.next();
			if(x.equals("!!!!!"))break;
			strSet.add(x);
			
		}
		System.out.println(strSet.size());
		Iterator item = strSet.iterator();
		while(item.hasNext()&&i<10){
		    i++;
			System.out.println(item.next());
		}
		}

}
